<!--内容赋值-->
<?php

if($editFlag ==1)
    $this->title= "编辑地址";
else
    $this->title= "新增地址";
$this->context->bodyClass="page-address";
$defalutId = Yii::$app->request->get('uid');
?>
<!--加载样式-->
<?php $this->beginBlock('css');?>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<?=Yii::getAlias('@static')?>/wap/liketry/css/cart.css">
<?php $this->endBlock();?>
<!--开始头部-->
<header>
    <div class="header-left" id="back"><span class="icon icon-arrow-left"></span></div>
    <h1><?php if($editFlag ==1):?>编辑地址<?php else:?>新增地址<?php endif;?></h1>
</header>
<section class="address-add" id="addressAdd">
    <ul class="form-list">
        <li>
            <label class="box">
                <div class="list-name">收货人</div>
                <div class="list-value flex1">
                    <input type="text" id="name" placeholder="请填写用户名" maxlength="10" <?php if($editFlag ==0 && isset($memberInfo->true_name)):?> value="<?=$memberInfo->true_name?>" <?php else:?> value="<?=$memberInfo->consignee?>" <?php endif;?>  >
                </div>
            </label>
        </li>
        <li><label class="box"><div class="list-name">手机号码</div><div class="list-value flex1">
                    <input type="tel" id="cell"  placeholder="请输入手机号" name="consignee" maxlength="11" <?php if($editFlag ==0 && isset($memberInfo->cell)):?> value="" <?php else:?> value="<?=$memberInfo->cell?>" <?php endif;?>>
                </div></label></li>
        <li id="areaWrap"><label class="box"><div class="list-name">所在区域</div><div class="list-value flex1">
                    <input type="text" id="area" readonly placeholder="请选择地址" <?php if($editFlag ==1):?>value="<?php if($editFlag ==1) echo $memberInfo->s1.'-'.$memberInfo->s2.'-'.$memberInfo->s3 ;?> " <?php endif;?>>
                </div><div class="flex1 icon icon-arrow-right2"></div></label></li>

        <li><label class="box box-top"><div class="list-name">详细地址</div><div class="list-value flex1"><textarea maxlength="100" name="address" id="detail" placeholder="请填写详细地址"><?php if($editFlag ==1)echo $memberInfo->address?></textarea></div></label></li>
    </ul>
    <div class="address-setdefault <?php if($editFlag ==1 && $memberInfo->is_default==1):?> selected<?php endif;?>" id="addressSetDefault">设为默认地址<span class="switch"></span></div>
	<div class="address-error error" id="addressError"></div>
</section>
<div class="bottom-btn" id="addressSave">保存</div>
<div class="area-page" id="areaPage"></div>
<!--加载js-->
<?php $this->beginBlock('js');?>
<script src="<?=Yii::getAlias('@static')?>/wap/common/js/zepto.min.js"></script>
<script src="<?=Yii::getAlias('@static')?>/wap/common/js/fastclick.min.js"></script>
<script src="<?=Yii::getAlias('@static')?>/wap/common/js/king.wap.js"></script>
<script src="<?= Yii::getAlias('@static') ?>/wap/common/js/iscroll-lite.js"></script>
<script src="<?= Yii::getAlias('@static') ?>/wap/liketry/js/address.js"></script>
<script>
var addressOrderUrl = '<?=Yii::$app->urlManager->createUrl(["member-address/listorder"]);?>';
var areaUrl = '<?=Yii::$app->urlManager->createUrl(["member-address/area-ajax"]);?>';
var areaPageUrl = '<?=Yii::$app->urlManager->createUrl(["member-address/area"]);?>';
var addressSave = '<?=Yii::$app->urlManager->createUrl(["member-address/save-ajax"]);?>';
var addressListUrl = '<?=Yii::$app->urlManager->createUrl(["member-address/list"]);?>';
var editFlag = '<?=$editFlag?>';
var uid = '<?=$memberInfo->uid?>';
</script>
<?php $this->endBlock();?>
